package com.mars.basic.allmain.vo;

import com.mars.basic.allmain.entity.PermissionEntity;
import com.mars.basic.allmain.po.Permission;
import com.mars.common.utils.Beans;
import lombok.Data;

import java.util.Date;

@Data
public class PermissionVo {

    private  String name;

    private String type;

    private String url;

    private Date createTime;

    private Date updateTime;


    public PermissionEntity build(){
        Permission permission = PermissionEntity.builder().name(name)
                .createTime(new Date())
                .updateTime(new Date())
                .url(url)
                .status("0").build();

        PermissionEntity entity = Beans.mapper(permission, PermissionEntity.class);
        return entity;
    }
}
